********* TABLE A2 *********
clear all
set more off 
capture log close

* main path to data
global path "~/Dropbox/Paraguay/1_data/7_replication_dataverse"
capture cd "$path"	

*tables = analysis tables
global tables "$path/tables"

use "$path/data/centrality_family.dta", clear


eststo clear

* Get number of observations
count if sample_weight == 1 
local n = r(N)

* Rename variables with capitals
rename eigenvector Eigenvector
rename betweenness Betweenness
rename degree Degree

* Calculate correlations for our sample and one year (its a time-invariant variable)
correlate Eigenvector Betweenness Degree if sample_weight == 1 
matrix C = r(C)

estout matrix(C, fmt(%9.3f)) using "$tables/tableA2.tex", ///
    style(tex) replace ///
    prehead("\begin{tabular}{lccc} \hline\hline" ///
           "& Eigenvector & Degree & Betweenness \\ \hline") ///
    postfoot("\hline\hline \\" ///
            "\multicolumn{4}{l}{\footnotesize Observations: `n'} \\" ///
            "\end{tabular}") ///
    cells("") ///
    varwidth(20) ///
    nolabel ///
    mlabels(none) ///
    collabels(none)
